﻿using System;
using RayTracing;
using System.Numerics;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Windows.Media;

namespace RayTracingTests
{
    [TestClass]
    public class Basis
    {
        [TestMethod]
        public void TestHit()
        {
            var ray = new Ray
            {
                Origin = new Vector3(0.0f, 0.5f, -1.0f),
                Direction = new Vector3(0.0f, 0.0f, 1.0f)
            };
            var triangle = new Triangle(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(1.0f, 0.0f, 0.0f), Colors.White);
            Assert.IsTrue(triangle.Hit(ray, float.MinValue, float.MaxValue, 0.0f, out var record));
            Assert.AreEqual(record.Time, 1.0f);
        }
    }
}
